package work.mediway.mdm.biz.vo.biz;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

import cn.hutool.core.collection.CollUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.mediway.mdm.core.vo.BaseCtVO;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2020/12/17
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel
public class PatientEditLogVO extends BaseCtVO {

    @ApiModelProperty(value = "登记号")
    private String patPatientId;

    @ApiModelProperty(value = "操作类型(A-新增,U-更新,D-删除)")
    private String editTypeCode;

    @ApiModelProperty(value = "操作类型(A-新增,U-更新,D-删除)")
    private String editTypeDesc;

    @ApiModelProperty(value = "操作者")
    private String lastUpdateUserId;

    @JsonIgnore
    @ApiModelProperty(value = "修改前值")
    private String beforeEdit;

    @JsonIgnore
    @ApiModelProperty(value = "修改后值")
    private String afterEdit;

    @JsonIgnore
    @ApiModelProperty(value = "操作日期")
    private String editUpdateDate;

    @JsonIgnore
    @ApiModelProperty(value = "操作时间")
    private String editUpdateTime;

    @ApiModelProperty(value = "操作日期时间")
    private String editUpdateDateTime;

    private List<ChangeDetail> details = CollUtil.newArrayList();

    @Data
    public static class ChangeDetail {

        @ApiModelProperty(value = "字段名称")
        private String fieldName;

        @ApiModelProperty(value = "变化前值")
        private String oldValue;

        @ApiModelProperty(value = "变化后值")
        private String newValue;

        @ApiModelProperty(value = "描述")
        private String descr;

        @ApiModelProperty(value = "字段类型")
        private String type;

    }
}
